package com.firmye.codereposboot.controller.orders.json;

import com.firmye.codereposboot.controller.BaseController;
import com.firmye.codereposboot.model.commons.CustResponse;
import com.firmye.codereposboot.service.OrdersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/ordersJ")
public class OrdersController extends BaseController {

    @Autowired
    private OrdersService ordersService;

    @GetMapping("/batch")
    public CustResponse batchCreate(){
        try {
            return success("成功生成订单",ordersService.batchCreate());
        }catch (Exception e){
            return error("生成订单失败",e);
        }
    }

}
